#include <stdio.h>
#include <math.h>
int main()
{
	int n,sum;
	scanf("%d",&n);
	sum = (1+n)*n/2;
	for(int i = 2;i<=(int)sqrt(sum);i++)
	{
		if(sum%i==0)
		{
			printf("%d\n",sum/i);
			return 0;
		} 
	}
}
